package org.jeecg.modules.tankerRegistration.util;

/**
 * 坐标解析工具类
 */
public class CoordinateParser {
    public static class Doubles {
        public final double lon;
        public final double lat;

        Doubles(double lon, double lat) {
            this.lon = lon;
            this.lat = lat;
        }
    }

    public static Doubles parse(String coordinate) {
        String[] parts = coordinate.split(",");
        return new Doubles(
                Double.parseDouble(parts[0].trim()),
                Double.parseDouble(parts[1].trim())
        );
    }

    public static Doubles parseGpsRecord(String lon, String lat) {
        return new Doubles(
                Double.parseDouble(lon) / 600000.0,
                Double.parseDouble(lat) / 600000.0
        );
    }
}
